#ifndef __GAME_H__
#define __GAME_H__

#include "cocos2d.h"
#include "Background.h"

class Game : public Background 
{
public:
	Game();
	~Game();

	// Here's a difference. Method 'init' in cocos2d-x returns bool, 
    // instead of returning 'id' in cocos2d-iphone
	bool init();  

	// there's no 'id' in cpp, so we recommand to return the exactly class pointer
	static cocos2d::CCScene* scene();

	void initPlatforms();

	void initPlatform();

	void startGame();

	void resetPlatforms();

	void resetPlatform();

	void resetBird();

	void resetBonus();

	void step(float dt);

	void jump();

	virtual void didAccelerate(cocos2d::CCAcceleration* pAccelerationValue);

	void registerWithTouchDispatcher();

	// implement the "static node()" method manually
	CREATE_FUNC(Game);

    
    
protected:
	cocos2d::CCPoint bird_pos;
	cocos2d::ccVertex2F bird_vel;
	cocos2d::ccVertex2F bird_acc;	

	float currentPlatformY;
	int currentPlatformTag;
	float currentMaxPlatformStep;
	int currentBonusPlatformIndex;
	int currentBonusType;
	int platformCount;
	
	bool gameSuspended;
	bool birdLookingRight;
	
	int score;


};

#endif  // __HELLOWORLD_SCENE_H__